<?php
/**
 * Created by PhpStorm.
 * User: leo
 * Date: 2018/5/14
 * Time: 14:58
 */
session_start();
$num=$_POST['num'];
$name=$_POST['name'];
include '../classes/conn.php';
if(isset($_SESSION['admin_num'])) {
    $query1="select num from teacher where num='{$num}'";
    $res=mysql_query($query1);
    if(mysql_num_rows($res)){
        $query="update teacher set name ='{$name}' where num='{$num}'";
        mysql_query($query);
        echo '1';
    }
    else echo 'no_exist';

}
else echo 'no_login';